import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

import path from 'path'
// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  envPrefix:"APP_",//APP_  为自定义开头名
  server: {
    proxy: {
      "/api": {
        target: "http://dev.com:8080/plastic/",
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, ""),
      },
    },
  },
  resolve:{
    // 使用别名
    alias: [
      {
        find: '@',
        replacement: path.resolve('./src')
      }
    ]
  }
})
